<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;

class QiniuController extends AdminController
{
    //
    public $Wgravity = [
        'NorthWest',
        'North',
        'NorthEast',
        'West',
        'Center',
        'East',
        'SouthWest',
        'South',
        'SouthEast'
    ];

    /*配置显示*/
    public function config()
    {
        $config = getQiniuConfig();
        $Wgravity = $this->Wgravity;
        return view('admin.qiniu.qiniu', compact('config','Wgravity'));
    }
    /*配置保存*/
    public function save(Request $request)
    {
        foreach($request->except('_token') as $key => $value)
        {
            setQiniuConfig($key,$value);
        }
        return redirect('admin/QiniuConfig');
    }
}
